<% if customer_return.order.present? %>
  <tr
    id="<%= spree_dom_id customer_return %>"
    data-controller="row-link"
    class="cursor-pointer"
  >
    <td class="font-weight-bold" data-action="click->row-link#openLink">
      <% if can?(:edit, customer_return) %>
        <%= link_to customer_return.number,
        spree.edit_admin_order_customer_return_path( customer_return.order, customer_return),
        data: {
          row_link_target: "link",
        } %>
      <% else %>
        <%= customer_return.number %>
      <% end %>
    </td>
    <td data-action="click->row-link#openLink"><%= spree_time(customer_return.created_at) %></td>
    <td data-action="click->row-link#openLink"><%= render "spree/admin/orders/customer_summary", order: customer_return.order %></td>
    <td data-action="click->row-link#openLink"><%= link_to customer_return.order.number,
      spree.edit_admin_order_path(customer_return.order) %></td>
    <td data-action="click->row-link#openLink">
      <% if customer_return.fully_reimbursed? %>
        <span class="badge badge-success"><%= Spree.t(:reimbursed) %></span>
      <% else %>
        <span class="badge badge-inactive"><%= Spree.t(:incomplete) %></span>
      <% end %>
    </td>
    <td data-action="click->row-link#openLink"><%= customer_return.display_pre_tax_total.to_html %></td>
  </tr>
<% end %>
